<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="../../Build/react.development.js"></script>
    <script src="../../Build/react-dom.development.js"></script>
    <script src="../../Build/babel.min.js"></script>
  </head>
  <body>
    <div id="app"></div>
    <script type="text/babel">
      var data = '123';
      class MyTitle extends React.Component {
        // TODO: propTypes目前已废弃
        static propTypes = {
          title: React.PropTypes.string.isRequired,
        }
        render () {
          return <h1>{this.props.title}</h1>
        }
      }
      // var MyTitle = React.createClass({
      //   propTypes: {
      //     title: React.PropTypes.string.isRequired,
      //   },
      //   render () {
      //     return <h1>{this.props.title}</h1>
      //   }
      // })
      ReactDOM.render(
        <MyTitle title={data}/>,
        document.getElementById('app')
      )
    </script>
  </body>
</html>